/*
 * Copyright (C) 2019 Unigroup Spreadtrum & RDA Technologies Co., Ltd.
 *
 * This file is dual-licensed: you can use it either under the terms
 * of the GPL or the X11 license, at your option. Note that this dual
 * licensing only applies to this file, and not this project as a
 * whole.
 *
 * updated at 2019-02-11 15:07:05
 *
 */


#ifndef AON_DBG_APB_H
#define AON_DBG_APB_H

#define CTL_BASE_AON_DBG_APB 0x63640000


#define REG_AON_DBG_APB_APCPU_COMM_CTRL              ( CTL_BASE_AON_DBG_APB + 0x0000 )
#define REG_AON_DBG_APB_APCPU_PROT_CTRL              ( CTL_BASE_AON_DBG_APB + 0x0004 )
#define REG_AON_DBG_APB_CSSYS_CFG                    ( CTL_BASE_AON_DBG_APB + 0x0008 )
#define REG_AON_DBG_APB_APCPU_PROT_CTRL_NON_SEC      ( CTL_BASE_AON_DBG_APB + 0x0010 )
#define REG_AON_DBG_APB_CSSYS_CFG_NON_SEC            ( CTL_BASE_AON_DBG_APB + 0x0014 )
#define REG_AON_DBG_APB_PSCP_CR8_PROT_CTRL           ( CTL_BASE_AON_DBG_APB + 0x0020 )
#define REG_AON_DBG_APB_PSCP_CR8_PROT_CTRL_NON_SEC   ( CTL_BASE_AON_DBG_APB + 0x0024 )
#define REG_AON_DBG_APB_NRCP_CR8_PROT_CTRL           ( CTL_BASE_AON_DBG_APB + 0x0028 )
#define REG_AON_DBG_APB_NRCP_CR8_PROT_CTRL_NON_SEC   ( CTL_BASE_AON_DBG_APB + 0x002C )
#define REG_AON_DBG_APB_V3PS_CR5_PROT_CTRL           ( CTL_BASE_AON_DBG_APB + 0x0030 )
#define REG_AON_DBG_APB_V3PS_CR5_PROT_CTRL_NON_SEC   ( CTL_BASE_AON_DBG_APB + 0x0034 )
#define REG_AON_DBG_APB_V3PHY_CR5_PROT_CTRL          ( CTL_BASE_AON_DBG_APB + 0x0038 )
#define REG_AON_DBG_APB_V3PHY_CR5_PROT_CTRL_NON_SEC  ( CTL_BASE_AON_DBG_APB + 0x003C )
#define REG_AON_DBG_APB_DEBUG_BOND_OPTION            ( CTL_BASE_AON_DBG_APB + 0x0040 )

/* REG_AON_DBG_APB_APCPU_COMM_CTRL */

#define BIT_AON_DBG_APB_APCPU_AWSTASHLPIDENS      BIT(20)
#define BIT_AON_DBG_APB_APCPU_AWSTASHLPIDS(x)     (((x) & 0xF) << 16)
#define BIT_AON_DBG_APB_APCPU_CFGTE(x)            (((x) & 0xFF) << 8)
#define BIT_AON_DBG_APB_APCPU_AA64NAA32(x)        (((x) & 0xFF))

/* REG_AON_DBG_APB_APCPU_PROT_CTRL */

#define BIT_AON_DBG_APB_APCPU_SPNIDEN             BIT(3)
#define BIT_AON_DBG_APB_APCPU_SPIDEN              BIT(2)
#define BIT_AON_DBG_APB_APCPU_NIDEN               BIT(1)
#define BIT_AON_DBG_APB_APCPU_DBGEN               BIT(0)

/* REG_AON_DBG_APB_CSSYS_CFG */

#define BIT_AON_DBG_APB_DAP_DEVICEEN              BIT(31)
#define BIT_AON_DBG_APB_DAP_DBGEN                 BIT(30)
#define BIT_AON_DBG_APB_DAP_SPIDBGEN              BIT(29)
#define BIT_AON_DBG_APB_NR_DSP1_JTAG_EN           BIT(10)
#define BIT_AON_DBG_APB_NR_DSP0_JTAG_EN           BIT(9)
#define BIT_AON_DBG_APB_AON_CM4_DBGEN             BIT(8)
#define BIT_AON_DBG_APB_DJTAG_EN_1                BIT(7)
#define BIT_AON_DBG_APB_DJTAG_EN_0                BIT(6)
#define BIT_AON_DBG_APB_AG_JTAG_EN                BIT(5)
#define BIT_AON_DBG_APB_MJTAG_EN                  BIT(4)
#define BIT_AON_DBG_APB_CSSYS_NIDEN               BIT(3)
#define BIT_AON_DBG_APB_CSSYS_SPNIDEN             BIT(2)
#define BIT_AON_DBG_APB_CSSYS_SPIDEN              BIT(1)
#define BIT_AON_DBG_APB_CSSYS_DBGEN               BIT(0)

/* REG_AON_DBG_APB_APCPU_PROT_CTRL_NON_SEC */

#define BIT_AON_DBG_APB_APCPU_SPNIDEN_NON_SEC     BIT(3)
#define BIT_AON_DBG_APB_APCPU_SPIDEN_NON_SEC      BIT(2)
#define BIT_AON_DBG_APB_APCPU_NIDEN_NON_SEC       BIT(1)
#define BIT_AON_DBG_APB_APCPU_DBGEN_NON_SEC       BIT(0)

/* REG_AON_DBG_APB_CSSYS_CFG_NON_SEC */

#define BIT_AON_DBG_APB_DAP_DEVICEEN_NON_SEC      BIT(31)
#define BIT_AON_DBG_APB_DAP_DBGEN_NON_SEC         BIT(30)
#define BIT_AON_DBG_APB_DAP_SPIDBGEN_NON_SEC      BIT(29)
#define BIT_AON_DBG_APB_NR_DSP1_JTAG_EN_NON_SEC   BIT(10)
#define BIT_AON_DBG_APB_NR_DSP0_JTAG_EN_NON_SEC   BIT(9)
#define BIT_AON_DBG_APB_AON_CM4_DBGEN_NON_SEC     BIT(8)
#define BIT_AON_DBG_APB_DJTAG_EN_NON_SEC_1        BIT(7)
#define BIT_AON_DBG_APB_DJTAG_EN_NON_SEC_0        BIT(6)
#define BIT_AON_DBG_APB_AG_JTAG_EN_NON_SEC        BIT(5)
#define BIT_AON_DBG_APB_MJTAG_EN_NON_SEC          BIT(4)
#define BIT_AON_DBG_APB_CSSYS_NIDEN_NON_SEC       BIT(3)
#define BIT_AON_DBG_APB_CSSYS_SPNIDEN_NON_SEC     BIT(2)
#define BIT_AON_DBG_APB_CSSYS_SPIDEN_NON_SEC      BIT(1)
#define BIT_AON_DBG_APB_CSSYS_DBGEN_NON_SEC       BIT(0)

/* REG_AON_DBG_APB_PSCP_CR8_PROT_CTRL */

#define BIT_AON_DBG_APB_PSCP_CR8_1_NIDEN          BIT(3)
#define BIT_AON_DBG_APB_PSCP_CR8_1_DBGEN          BIT(2)
#define BIT_AON_DBG_APB_PSCP_CR8_0_NIDEN          BIT(1)
#define BIT_AON_DBG_APB_PSCP_CR8_0_DBGEN          BIT(0)

/* REG_AON_DBG_APB_PSCP_CR8_PROT_CTRL_NON_SEC */

#define BIT_AON_DBG_APB_PSCP_CR8_1_NIDEN_NON_SEC  BIT(3)
#define BIT_AON_DBG_APB_PSCP_CR8_1_DBGEN_NON_SEC  BIT(2)
#define BIT_AON_DBG_APB_PSCP_CR8_0_NIDEN_NON_SEC  BIT(1)
#define BIT_AON_DBG_APB_PSCP_CR8_0_DBGEN_NON_SEC  BIT(0)

/* REG_AON_DBG_APB_NRCP_CR8_PROT_CTRL */

#define BIT_AON_DBG_APB_NRCP_CR8_1_NIDEN          BIT(3)
#define BIT_AON_DBG_APB_NRCP_CR8_1_DBGEN          BIT(2)
#define BIT_AON_DBG_APB_NRCP_CR8_0_NIDEN          BIT(1)
#define BIT_AON_DBG_APB_NRCP_CR8_0_DBGEN          BIT(0)

/* REG_AON_DBG_APB_NRCP_CR8_PROT_CTRL_NON_SEC */

#define BIT_AON_DBG_APB_NRCP_CR8_1_NIDEN_NON_SEC  BIT(3)
#define BIT_AON_DBG_APB_NRCP_CR8_1_DBGEN_NON_SEC  BIT(2)
#define BIT_AON_DBG_APB_NRCP_CR8_0_NIDEN_NON_SEC  BIT(1)
#define BIT_AON_DBG_APB_NRCP_CR8_0_DBGEN_NON_SEC  BIT(0)

/* REG_AON_DBG_APB_V3PS_CR5_PROT_CTRL */

#define BIT_AON_DBG_APB_V3PS_CR5_NIDEN            BIT(1)
#define BIT_AON_DBG_APB_V3PS_CR5_DBGEN            BIT(0)

/* REG_AON_DBG_APB_V3PS_CR5_PROT_CTRL_NON_SEC */

#define BIT_AON_DBG_APB_V3PS_CR5_NIDEN_NON_SEC    BIT(1)
#define BIT_AON_DBG_APB_V3PS_CR5_DBGEN_NON_SEC    BIT(0)

/* REG_AON_DBG_APB_V3PHY_CR5_PROT_CTRL */

#define BIT_AON_DBG_APB_V3PHY_CR5_NIDEN           BIT(1)
#define BIT_AON_DBG_APB_V3PHY_CR5_DBGEN           BIT(0)

/* REG_AON_DBG_APB_V3PHY_CR5_PROT_CTRL_NON_SEC */

#define BIT_AON_DBG_APB_V3PHY_CR5_NIDEN_NON_SEC   BIT(1)
#define BIT_AON_DBG_APB_V3PHY_CR5_DBGEN_NON_SEC   BIT(0)

/* REG_AON_DBG_APB_DEBUG_BOND_OPTION */

#define BIT_AON_DBG_APB_EFUSE_DEBUG_BOND_OFF      BIT(31)
#define BIT_AON_DBG_APB_EFUSE_SECURE_DEBUG        BIT(30)


#endif /* AON_DBG_APB_H */


